import org.python.core.*;

public class appletp extends java.applet.Applet implements org.python.core.PyProxy, org.python.core.ClassDictInit {
    static String[] jpy$mainProperties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions"};
    static String[] jpy$proxyProperties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions", "python.options.showJavaExceptions", "true"};
    static String[] jpy$packages = new String[] {"java.applet", null};
    
    public static class _PyInner extends PyFunctionTable implements PyRunnable {
        private static PyObject s$0;
        private static PyObject i$1;
        private static PyObject s$2;
        private static PyFunctionTable funcTable;
        private static PyCode c$0_paint;
        private static PyCode c$1_appletp;
        private static PyCode c$2_main;
        private static void initConstants() {
            s$0 = Py.newString("Eu sou um Applet Jython!");
            i$1 = Py.newInteger(5);
            s$2 = Py.newString("/home/flavio/Documents/LivroPython/code/appletp.py");
            funcTable = new _PyInner();
            c$0_paint = Py.newCode(2, new String[] {"self", "g"}, "/home/flavio/Documents/LivroPython/code/appletp.py", "paint", false, false, funcTable, 0, null, null, 0, 1);
            c$1_appletp = Py.newCode(0, new String[] {}, "/home/flavio/Documents/LivroPython/code/appletp.py", "appletp", false, false, funcTable, 1, null, null, 0, 0);
            c$2_main = Py.newCode(0, new String[] {}, "/home/flavio/Documents/LivroPython/code/appletp.py", "main", false, false, funcTable, 2, null, null, 0, 0);
        }
        
        
        public PyCode getMain() {
            if (c$2_main == null) _PyInner.initConstants();
            return c$2_main;
        }
        
        public PyObject call_function(int index, PyFrame frame) {
            switch (index){
                case 0:
                return _PyInner.paint$1(frame);
                case 1:
                return _PyInner.appletp$2(frame);
                case 2:
                return _PyInner.main$3(frame);
                default:
                return null;
            }
        }
        
        private static PyObject paint$1(PyFrame frame) {
            frame.getlocal(1).invoke("drawString", new PyObject[] {s$0, i$1, i$1});
            return Py.None;
        }
        
        private static PyObject appletp$2(PyFrame frame) {
            frame.setlocal("paint", new PyFunction(frame.f_globals, new PyObject[] {}, c$0_paint));
            return frame.getf_locals();
        }
        
        private static PyObject main$3(PyFrame frame) {
            frame.setglobal("__file__", s$2);
            
            frame.setlocal("java", org.python.core.imp.importOne("java.applet.Applet", frame));
            frame.setlocal("appletp", Py.makeClass("appletp", new PyObject[] {frame.getname("java").__getattr__("applet").__getattr__("Applet")}, c$1_appletp, null, appletp.class));
            return Py.None;
        }
        
    }
    public static void moduleDictInit(PyObject dict) {
        dict.__setitem__("__name__", new PyString("appletp"));
        Py.runCode(new _PyInner().getMain(), dict, dict);
    }
    
    public static void main(String[] args) throws java.lang.Exception {
        String[] newargs = new String[args.length+1];
        newargs[0] = "appletp";
        System.arraycopy(args, 0, newargs, 1, args.length);
        Py.runMain(appletp._PyInner.class, newargs, appletp.jpy$packages, appletp.jpy$mainProperties, "", new String[] {"appletp"});
    }
    
    public void addImpl(java.awt.Component arg0, java.lang.Object arg1, int arg2) {
        super.addImpl(arg0, arg1, arg2);
    }
    
    public java.lang.Object clone() throws java.lang.CloneNotSupportedException {
        return super.clone();
    }
    
    public java.awt.AWTEvent coalesceEvents(java.awt.AWTEvent arg0, java.awt.AWTEvent arg1) {
        return super.coalesceEvents(arg0, arg1);
    }
    
    public void super__disableEvents(long arg0) {
        super.disableEvents(arg0);
    }
    
    public void super__enableEvents(long arg0) {
        super.enableEvents(arg0);
    }
    
    public void finalize() throws java.lang.Throwable {
        super.finalize();
    }
    
    public void firePropertyChange(java.lang.String arg0, java.lang.Object arg1, java.lang.Object arg2) {
        super.firePropertyChange(arg0, arg1, arg2);
    }
    
    public void firePropertyChange(java.lang.String arg0, boolean arg1, boolean arg2) {
        super.firePropertyChange(arg0, arg1, arg2);
    }
    
    public void firePropertyChange(java.lang.String arg0, int arg1, int arg2) {
        super.firePropertyChange(arg0, arg1, arg2);
    }
    
    public void super__paint(java.awt.Graphics arg0) {
        super.paint(arg0);
    }
    
    public void paint(java.awt.Graphics arg0) {
        PyObject inst = Py.jfindattr(this, "paint");
        if (inst != null) inst._jcall(new Object[] {arg0});
        else super.paint(arg0);
    }
    
    public java.lang.String paramString() {
        return super.paramString();
    }
    
    public void processComponentEvent(java.awt.event.ComponentEvent arg0) {
        super.processComponentEvent(arg0);
    }
    
    public void processContainerEvent(java.awt.event.ContainerEvent arg0) {
        super.processContainerEvent(arg0);
    }
    
    public void processEvent(java.awt.AWTEvent arg0) {
        super.processEvent(arg0);
    }
    
    public void processFocusEvent(java.awt.event.FocusEvent arg0) {
        super.processFocusEvent(arg0);
    }
    
    public void processHierarchyBoundsEvent(java.awt.event.HierarchyEvent arg0) {
        super.processHierarchyBoundsEvent(arg0);
    }
    
    public void processHierarchyEvent(java.awt.event.HierarchyEvent arg0) {
        super.processHierarchyEvent(arg0);
    }
    
    public void processInputMethodEvent(java.awt.event.InputMethodEvent arg0) {
        super.processInputMethodEvent(arg0);
    }
    
    public void processKeyEvent(java.awt.event.KeyEvent arg0) {
        super.processKeyEvent(arg0);
    }
    
    public void processMouseEvent(java.awt.event.MouseEvent arg0) {
        super.processMouseEvent(arg0);
    }
    
    public void processMouseMotionEvent(java.awt.event.MouseEvent arg0) {
        super.processMouseMotionEvent(arg0);
    }
    
    public void processMouseWheelEvent(java.awt.event.MouseWheelEvent arg0) {
        super.processMouseWheelEvent(arg0);
    }
    
    public boolean requestFocus(boolean arg0) {
        return super.requestFocus(arg0);
    }
    
    public boolean requestFocusInWindow(boolean arg0) {
        return super.requestFocusInWindow(arg0);
    }
    
    public void validateTree() {
        super.validateTree();
    }
    
    public appletp() throws java.awt.HeadlessException {
        super();
        __initProxy__(new Object[] {});
    }
    
    private PyInstance __proxy;
    public void _setPyInstance(PyInstance inst) {
        __proxy = inst;
    }
    
    public PyInstance _getPyInstance() {
        return __proxy;
    }
    
    private PySystemState __sysstate;
    public void _setPySystemState(PySystemState inst) {
        __sysstate = inst;
    }
    
    public PySystemState _getPySystemState() {
        return __sysstate;
    }
    
    public void __initProxy__(Object[] args) {
        Py.initProxy(this, "appletp", "appletp", args, appletp.jpy$packages, appletp.jpy$proxyProperties, "", new String[] {"appletp"});
    }
    
    static public void classDictInit(PyObject dict) {
        dict.__setitem__("__supernames__", Py.java2py(new String[] {"processInputMethodEvent", "finalize", "requestFocus", "firePropertyChange", "processMouseWheelEvent", "processEvent", "processComponentEvent", "paramString", "coalesceEvents", "requestFocusInWindow", "super__disableEvents", "super__enableEvents", "super__paint", "processMouseEvent", "processKeyEvent", "addImpl", "validateTree", "processHierarchyBoundsEvent", "processMouseMotionEvent", "clone", "processContainerEvent", "processFocusEvent", "processHierarchyEvent"}));
    }
    
}
